#include <windows.h>
#include <iostream>
#include <fstream>

#include "xmlPluginlist.h"

using namespace std; 

extern char currentPath[512];
extern char pluginlist_path[512];

 int main()
 {
	_CrtDumpMemoryLeaks(); 
	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );  
	//_CrtSetBreakAlloc(127);
	//get current path
	GetCurrentPath();


	
	cout << "Path is :" << currentPath << endl;
	cout << "pluginlist_path is :" << pluginlist_path << endl;
	cout << "update plugins ..." << endl;

	createPluginlist();

	//int handle;
	//_finddata_t fileinfo;
	//handle = _findfirst(finder,&fileinfo);
	//if(-1 == handle)
	//	cout << "Path is :" << currentPath << "no plugin file"<<endl;

	//fp = fopen(strcat(pluginlist_path,"plugins.lst"),"w");

	//while(!_findnext(handle,&fileinfo))
	//{
	//	//memset(tempname,'\0',256);
	//	strcpy(tempname,fileinfo.name);
	//	strcat(tempname,"?");
	//	size = strlen(tempname);
	//	fwrite(tempname,size,1,fp);
	//}
	//
	//fclose(fp);
	//
	//_findclose(handle);
	system("pause");

 }